package com.app.sicwvbiaalg;

import com.hx.zhg.util.FileUtilExt;
import com.hx.zhg.util.LibUtil;

public class MainActivity {


    public static void main(String[] args) throws Exception {

        FileUtilExt.loadCopyResources("native/*");
        LibUtil.setDefaultJavaLibraryPath("native");
        System.loadLibrary("TmlWvBiaAlgAC4001");

        int BiaAlgVersion, BiaErrFlag;
        int BWR, VFR;

        SicWvBiaAlgInInfJClass PersonJ = new SicWvBiaAlgInInfJClass();
        SicWvBiaAlgOutInfJClass BodyJ = new SicWvBiaAlgOutInfJClass();

        byte Sex = 1;
        short Age = 330;
        short Height = 1780;
        short Weight = 7670;
        int Impedance = 450;

        PersonJ.setSex(Sex);
        PersonJ.setAge(Age);
        PersonJ.setHeight(Height);
        PersonJ.setWeight(Weight);
        PersonJ.setImpedance(Impedance);

        //调用算法
        BodyJ = SicWvBiaAlgJCLinker.SicWvBiaAlgJCLink(PersonJ);

        BiaAlgVersion = BodyJ.getBIA_ALG_VERSION_ID();
        BiaErrFlag = BodyJ.getErrFlag();
        BWR = BodyJ.getBWR();
        VFR = BodyJ.getVFR();

        System.out.println("输入数据：" + "\n" +
                "性别:" + PersonJ.getSex() + "\n" +
                "年龄:" + PersonJ.getAge() + "\n" +
                "身高:" + PersonJ.getHeight() + "\n" +
                "体重:" + PersonJ.getWeight() + "\n" +
                "阻抗:" + PersonJ.getImpedance() + "\n" +
                "分析结果如下:" + "\n" +
                "算法版本号：" + BiaAlgVersion + "\n" +
                "BiaErrFlag:" + BiaErrFlag + "\n" +
                "BWR:" + BWR / 100.0f + "\n" +
                "VFR:" + VFR / 100.0f + "\n"
        );
    }
}



